<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Agile Modbus: /home/runner/work/agile_modbus/agile_modbus/inc/agile_modbus_tcp.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Agile Modbus
   &#160;<span id="projectnumber">1.1.4</span>
   </div>
   <div id="projectbrief">Lightweight modbus protocol stack.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('agile__modbus__tcp_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">agile_modbus_tcp.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="agile__modbus__tcp_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#ifndef __PKG_AGILE_MODBUS_TCP_H</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#define __PKG_AGILE_MODBUS_TCP_H</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#if AGILE_MODBUS_USING_TCP</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="group___t_c_p___exported___constants.html#gacae695692d9e813a6606a44fa36b807d">   32</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_TCP_HEADER_LENGTH     7</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="group___t_c_p___exported___constants.html#gac012bade0617291b78e007393f72b2e8">   33</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_TCP_PRESET_REQ_LENGTH 12</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="group___t_c_p___exported___constants.html#ga3e02eaed8e08d8e34bccdd785fa09da4">   34</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_TCP_PRESET_RSP_LENGTH 8</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="group___t_c_p___exported___constants.html#ga12e0bfa5b136035efbb03a7c2885cf8b">   36</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_TCP_CHECKSUM_LENGTH 0</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="group___t_c_p___exported___constants.html#ga8872b1fc07bcf9f2c723f5f05cded968">   45</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_TCP_MAX_ADU_LENGTH 260</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="structagile__modbus__tcp.html">   57</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structagile__modbus__tcp.html">agile_modbus_tcp</a> {</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structagile__modbus__tcp.html#a0609cfbb362720398ab9ab2027acf020">   58</a></span>&#160;    <a class="code" href="structagile__modbus.html">agile_modbus_t</a> <a class="code" href="structagile__modbus__tcp.html#a0609cfbb362720398ab9ab2027acf020">_ctx</a>; </div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="structagile__modbus__tcp.html#a5e7cd9a4f62bbcade736030cea7f0f56">   59</a></span>&#160;    uint16_t <a class="code" href="structagile__modbus__tcp.html#a5e7cd9a4f62bbcade736030cea7f0f56">t_id</a>;       </div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="group___t_c_p___exported___types.html#ga2781db6d3f66711d6ee7cb178e0c1beb">   63</a></span>&#160;} <a class="code" href="group___t_c_p___exported___types.html#ga2781db6d3f66711d6ee7cb178e0c1beb">agile_modbus_tcp_t</a>;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___t_c_p___exported___functions.html#ga4f9b3e37c01e6f112f63e7194dad7b33">agile_modbus_tcp_init</a>(<a class="code" href="structagile__modbus__tcp.html">agile_modbus_tcp_t</a> *ctx, uint8_t *send_buf, <span class="keywordtype">int</span> send_bufsz, uint8_t *read_buf, <span class="keywordtype">int</span> read_bufsz);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;}</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* AGILE_MODBUS_USING_TCP */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* __PKG_AGILE_MODBUS_TCP_H */</span><span class="preprocessor"></span></div>
<div class="ttc" id="agroup___t_c_p___exported___functions_html_ga4f9b3e37c01e6f112f63e7194dad7b33"><div class="ttname"><a href="group___t_c_p___exported___functions.html#ga4f9b3e37c01e6f112f63e7194dad7b33">agile_modbus_tcp_init</a></div><div class="ttdeci">int agile_modbus_tcp_init(agile_modbus_tcp_t *ctx, uint8_t *send_buf, int send_bufsz, uint8_t *read_buf, int read_bufsz)</div><div class="ttdoc">TCP initialization.</div><div class="ttdef"><b>Definition:</b> <a href="agile__modbus__tcp_8c_source.html#l00217">agile_modbus_tcp.c:217</a></div></div>
<div class="ttc" id="agroup___t_c_p___exported___types_html_ga2781db6d3f66711d6ee7cb178e0c1beb"><div class="ttname"><a href="group___t_c_p___exported___types.html#ga2781db6d3f66711d6ee7cb178e0c1beb">agile_modbus_tcp_t</a></div><div class="ttdeci">struct agile_modbus_tcp agile_modbus_tcp_t</div><div class="ttdoc">TCP structure.</div></div>
<div class="ttc" id="astructagile__modbus__tcp_html"><div class="ttname"><a href="structagile__modbus__tcp.html">agile_modbus_tcp</a></div><div class="ttdoc">TCP structure.</div><div class="ttdef"><b>Definition:</b> <a href="agile__modbus__tcp_8h_source.html#l00057">agile_modbus_tcp.h:57</a></div></div>
<div class="ttc" id="astructagile__modbus__tcp_html_a0609cfbb362720398ab9ab2027acf020"><div class="ttname"><a href="structagile__modbus__tcp.html#a0609cfbb362720398ab9ab2027acf020">agile_modbus_tcp::_ctx</a></div><div class="ttdeci">agile_modbus_t _ctx</div><div class="ttdoc">modbus handle</div><div class="ttdef"><b>Definition:</b> <a href="agile__modbus__tcp_8h_source.html#l00058">agile_modbus_tcp.h:58</a></div></div>
<div class="ttc" id="astructagile__modbus__tcp_html_a5e7cd9a4f62bbcade736030cea7f0f56"><div class="ttname"><a href="structagile__modbus__tcp.html#a5e7cd9a4f62bbcade736030cea7f0f56">agile_modbus_tcp::t_id</a></div><div class="ttdeci">uint16_t t_id</div><div class="ttdoc">Extract from MODBUS Messaging on TCP/IP Implementation Guide V1.0b (page 23/46): The transaction iden...</div><div class="ttdef"><b>Definition:</b> <a href="agile__modbus__tcp_8h_source.html#l00059">agile_modbus_tcp.h:59</a></div></div>
<div class="ttc" id="astructagile__modbus_html"><div class="ttname"><a href="structagile__modbus.html">agile_modbus</a></div><div class="ttdoc">Agile Modbus structure.</div><div class="ttdef"><b>Definition:</b> <a href="agile__modbus_8h_source.html#l00217">agile_modbus.h:217</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_bfccd401955b95cf8c75461437045ac0.html">inc</a></li><li class="navelem"><a class="el" href="agile__modbus__tcp_8h.html">agile_modbus_tcp.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
